home *** CD-ROM | disk | FTP | other *** search
/ Internet Tools (InfoMagic) / Internet Tools.iso / dos_win / winsock / maillist / 94-05.Z / 94-05 / 000131_news@bigblue.oit.unc.edu_Fri May 9 21:13:45 1994.msg < prev    next >
Internet Message Format  |  1994-05-31  |  5KB

  1. Received: from bigblue.oit.unc.edu by SunSITE.Unc.EDU (5.65c+IDA/FvK-1.07) with SMTP
  2.           id AA28631; Tue, 10 May 1994 15:44:56 -0400
  3. Received: by bigblue.oit.unc.edu (AIX 3.2/UCB 5.64/4.03)
  4.           id AA10355; Tue, 10 May 1994 15:27:14 -0400
  5. Received: from GATEWAY by bigblue with netnews
  6.     for winsock@sunsite.unc.edu (winsock@sunsite.unc.edu)
  7. To: winsock@sunsite.unc.edu
  8. Date: 10 May 1994 04:13:45 -0700
  9. From: craign@teleport.com (Craig R. Nelson)
  10. Message-Id: <2qnq99$t6o@linda.teleport.com>
  11. Organization: Teleport - Portland's Public Access (503) 220-1016
  12. Sender: ses
  13. Subject: Closing/Killing a socket
  14.  
  15.  
  16. Hi there!
  17.  
  18. I know. Hard to believe. An actual windows sockets programming question. 
  19. My question is this. 
  20.  
  21. I am running Chameleon 4.004. I'm in the process of doing an nntp news 
  22. client-reader. One of the nntp commands is LIST\r\n and, as you might 
  23. expect, it fetches the whole list of newsgroups available from your 
  24. server. I would ike a gracefull way of killing this reception of the list 
  25. in midstream.
  26.  
  27. This is entirely being done with non-blocking asynchronous socket calls. 
  28. Using BC++ 4.0 and multiple inheritance response tables makes that part a 
  29. piece of cake. This is essentiall how it is working. Keep in mind that 
  30. this *is* C++ and therefore might look a litle strange. Let is suffice to 
  31. say that Manager is a class that receives socket notifications, and sock 
  32. is a socket object with all the underlying socket calls implemented within:
  33.  
  34. Manager::NotifyConnect()
  35. {
  36.   sock.AsyncSelect( FD_READ | FD_CLOSE );
  37.   sock.send( "LIST\r\n" );
  38. };
  39.  
  40.  
  41. Manager::NotifyRead()
  42. {
  43.   int nChars = sock.recv( recvBuffer, sizeof(recvBuffer)-1 );
  44.   recvBuffer[ nChars ] = 0;
  45.   ..process received characters..
  46. };
  47.  
  48. The trick part is in the CmCancel, a callback that responds to the 
  49. cancel=button of the loadList dialog. It is the only control (and the 
  50. only way) to close the dialog. I have tried various ways to kill the 
  51. socket from the TCP stack, the most horrid of which is:
  52.  
  53. void Manager::CmCancel()
  54. {
  55.   sock.AsyncSelect( 0 );
  56.   sock.shutdown( 2 );
  57.   sock.close();
  58.  
  59.   TDialog::CmCancel();
  60. }
  61.  
  62. But every time I do this the socket always ends up with a FIN ACKed state 
  63. and hangs around even though the close was successfull (so closesocket() 
  64. tells me).
  65.  
  66. Is there something I am missing on closing down a socket (possibly 
  67. rudely) that is recv'ing hordes of data? Should I be doing something with 
  68. ioctlsocket()? 
  69.  
  70. If the list is run to completion (which takes up to a minute over a 14kb 
  71. line) and then the dialog (and socket) are closed all is well and the 
  72. socket goes into quiet mode followed by falling out of the stack. I guess 
  73. what I'm asking is how can I tell the news server to quit sending data 
  74. since I don't want it anymore? Or is this even needed?
  75.  
  76. Thanks for all the help. Imagine that. An actual programming question in 
  77. the alt.winsock forum ... :-)
  78.  
  79. -- Craig
  80.  
  81. -- 
  82. []----------------------------------------------------[]
  83. | Craig Nelson   "I've upped my standards. Up Yours."  |
  84. | craign@teleport.com   as vague a .signature can get. |
  85. []----------------------------------------------------[]
  86. From news@bigblue.oit.unc.edu Tue May 10 11:36:00 1994
  87. Received: from bigblue.oit.unc.edu by SunSITE.Unc.EDU (5.65c+IDA/FvK-1.07) with SMTP
  88.           id AA04152; Tue, 10 May 1994 16:14:56 -0400
  89. Received: by bigblue.oit.unc.edu (AIX 3.2/UCB 5.64/4.03)
  90.           id AA16802; Tue, 10 May 1994 15:54:48 -0400
  91. Received: from GATEWAY by bigblue with netnews
  92.     for winsock@sunsite.unc.edu (winsock@sunsite.unc.edu)
  93. To: winsock@sunsite.unc.edu
  94. Date: Tue, 10 May 1994 11:36:00 GMT
  95. From: WhiskerP@lgwct.logica.com (Peter Whisker)
  96. Message-Id: <WhiskerP.257.2DCF719E@lgwct.logica.com>
  97. Organization: Logica DCG Ltd.
  98. Sender: ses
  99. Subject: NDIS Slip or PPP driver ?????
  100.  
  101. Anybody know of an NDIS (2 or 3) compliant SLIP or PPP driver.
  102.  
  103. It would be nice to be able to connect WFW 3.11 to a dial-in SLIP or PPP port 
  104. and be able to see the whole network.
  105.  
  106. The RAS (NETBeui) which comes with WFW is not what I would want to use.
  107.  
  108. Thanks
  109. Peter
  110. ~~~~~~~~~~~~~~~~~~~|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  111. Peter Whisker      | Internet: WhiskerP@lgwct.logica.com
  112. Logica DCG Ltd,    | X400 : WhiskerP/O=LG/OU=LGWCT/P=LOGICA/A=TMAILUK/C=GB
  113. Cobham, Surrey     | "Opinions are mine, not Logica's"
  114. Great Britain      | "B'shin tuairim phearsanta, nach leargas Logica"
  115. ~~~~~~~~~~~~~~~~~~~'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  116.